package com.leet.code.lcof;

import java.util.Stack;

public class Code09 {

    public static void main(String[] args) {
        CQueue cQueue = new CQueue();
    }

    static class CQueue {
        Stack<Integer> stack_push = new Stack<>();
        Stack<Integer> stack_pop = new Stack<>();

        boolean push = true;


        public CQueue() {

        }

        public void appendTail(int value) {
            stack_push.push(value);
        }

        public int deleteHead() {
            if (!stack_pop.empty()) {
                return stack_pop.pop();
            }

            if (stack_push.empty()) {
                return -1;
            }

            while (!stack_push.empty()) {
                stack_pop.push(stack_push.pop());
            }

            return stack_pop.pop();

        }


    }


}
